package com.dean.pokeking.utils

import com.dean.pokeking.beans.NpcButton
import com.dean.pokeking.beans.PlaceButton

/**
 * @ClassName TODO
 * @Description TODO
 * @Author Dean
 * @Date 2023/3/2
 * @Version 1.0
 */
class FakeDataUtil {
    companion object {
        fun getPlaceButtons(): List<PlaceButton> {
            return arrayListOf(
                PlaceButton(0,"关都联盟"),
                PlaceButton(1,"丰源联盟"),
                PlaceButton(2,"合众联盟"),
                PlaceButton(3,"神奥联盟"),
            )
        }
        fun getNpcButtons(): List<NpcButton> {
            return arrayListOf(
                NpcButton(0, "花月"),
                NpcButton(1, "菊子"),
                NpcButton(2, "芙蓉"),
                NpcButton(3, "源治"),
                NpcButton(4, "希罗娜"),
            )
        }
    }
}

class UniqueList<T> {
    private val list = mutableListOf<T>()

    fun add(element: T) {
        if (!list.contains(element)) {
            list.add(element)
        }
    }

    fun remove(element: T) {
        list.remove(element)
    }

    fun contains(element: T): Boolean {
        return list.contains(element)
    }

    fun size(): Int {
        return list.size
    }
}
